package com.skyblue.relation.dao;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.skyblue.relation.domain.Department;

public class DepartmentDaoImpl extends HibernateDaoSupport implements
		DepartmentDao {

	@Override
	public void add(Department department) {
		getHibernateTemplate().save(department);
		System.out.println("添加部门成功！");
	}

	@Override
	public List<Department> listAll() {
		System.out.println("开始列出部门");
		return (List<Department>)getHibernateTemplate()
				.find("from Department");
	}
}
